// 搜索列表查询（页面只有一个列表实现搜索、分页等）
function searchList(that,page,params,successCb,failCb,errorCb) {
	params.draw = that.draw;
	params.start = (page - 1) * that.pageSize;
	params.length = that.pageSize;
	axios.post(that.searchUrl, params,{headers: {'X-Requested-with':'XMLHttpRequest'}}).then(res => {
		if (res.data.Code == 0) {
			that.dataList = res.data.Data.Data;
			that.trAll = res.data.Data.recordsTotal;
			that.pageAll = Math.ceil(that.trAll / that.pageSize);
			that.pageCur = page;
			that.$refs.c1.indexes(that.pageAll,that.pageCur);
			successCb(res);
		} else {
			that.errorPsd = res.data.Msg;
			failCb(res);
		}
	}).catch(err => {
		errorCb(err);
		console.log(err);
	})
}

// 删除当前行（页面只有一个列表实现删除）
function deleteLine(that,params,successCb,failCb,errorCb){
	axios.post(that.delUrl,params,{headers: {'X-Requested-with':'XMLHttpRequest'}}).then(res => {
		// console.log(res);
		if(res.data.Code == 0){
			// 更新当前页内容
			that.pageTo(that.pageCur);
			//关闭模态框
			$('#confirm1').modal('toggle');
			//请求成功的回调
			successCb(res);
		} else {
			alert('删除失败');
			//关闭模态框
			$('#confirm1').modal('toggle');
			failCb(res);
		}
	}).catch(err => {
		errorCb(err);
	})
}
